/*
 * @Descripttion: 
 * @version: 
 * @Author: guangyunl
 * @Date: 2024-03-22 23:10:38
 * @LastEditors: guangyunl
 * @LastEditTime: 2024-04-01 15:24:45
 */
// 商品分类controller
'use strict';
const { Controller } = require('egg');

class cShoppings extends Controller {

  // wa
  // 查
  async wa_c_query() {
    const { ctx } = this;
    const result = await ctx.service.sShoppings.wa_s_query(ctx?.query ?? {});
    ctx.body = result;
  }




  //wc删除购物车单个商品
  async wa_c_delete_one() {
    const { ctx } = this;
    const result = await ctx.service.sShoppings.wa_s_delete_one(ctx?.request.body ?? {});
    ctx.body = result;
  }

  //wc删除购物车批量商品
  async wa_c_deleteMany() {
    const { ctx } = this;
    const result = await ctx.service.sShoppings.wa_s_deleteMany(ctx?.request.body ?? {});
    ctx.body = result;
  }

    //查询预结算商品
    async wa_c_queryJiesProducts() {
      const { ctx } = this;
      const result = await ctx.service.sShoppings.wa_s_queryJiesProducts(ctx?.request.body ?? {});
      ctx.body = result;
    }
  

  // 创建预订单
  async wa_c_createOrders() {
    const { ctx } = this;
    const result = await ctx.service.sShoppings.wa_s_createOrders(ctx?.request.body ?? {});
    ctx.body = result;
  }

    // 加入购物车
    async wa_c_createShopping() {
      const { ctx } = this;
      const result = await ctx.service.sShoppings.wa_s_createShopping(ctx?.request.body ?? {});
      ctx.body = result;
    }
    //查询用户订单
    async wa_c_queryOrders() {
      const { ctx } = this;
      const result = await ctx.service.sShoppings.wa_s_queryOrders(ctx?.query ?? {});
      ctx.body = result;
    }

    //查询用户默认地址
    async wa_c_queryDefaultAddress() {
      const { ctx } = this;
      const result = await ctx.service.sShoppings.wa_s_queryDefaultAddress(ctx?.query ?? {});
      ctx.body = result;
    }
  


}

module.exports = cShoppings;